import request from '@/utils/request'
const base = 'http://localhost:8001'
export default {
  // 分页查询
  getUserListPage(page, limit) {
    return request({
      baseURL: base,
      url: `/userInfo/getUserPage/${page}/${limit}`,
      method: 'get'
    })
  },
  updateFreeze: function(id, Freeze) {
    return request({
      baseURL: base,
      url: `/userInfo/updateFreeze`,
      method: 'post',
      params: {
        id, Freeze
      }
    })
  },
  getUserByName: function(pet, page, limit) {
    return request({
      baseURL: base,
      url: `/userInfo//getUserByPet/${pet}/${page}/${limit}`,
      method: 'get'
    })
  },
  getUserById: function(id) {
    return request({
      baseURL: base,
      url: `/userInfo/getUserById/${id}`,
      method: 'get'
    })
  },
  getUserByAccount: function(userName) {
    return request({
      baseURL: base,
      url: `/userInfo/getUserByName/${userName}`,
      method: 'get'
    })
  },
  setUserRoleById: function(id, role) {
    return request({
      baseURL: base,
      url: `/userInfo/setRoleById`,
      method: 'post',
      params: {
        id, role
      }

    })
  }
}
